import request from '@/utils/request'
import { getServicePath } from '@/api/baseUrlConfig'
const servicePath = getServicePath()
console.log(servicePath, 'servicePath')

// 添加或修改组织机构
export function addOrUpdOrg (data) {
  return request({
    url: servicePath.userServer + '/organization/addOrUpdOrg',
    headers: {
      showLoading: true
    },
    method: 'post',
    data
  })
}
// 获取组织机构形式
export function getOrgForm (data) {
  return request({
    url: servicePath.userServer + '/organization/getOrgForm',
    method: 'get',
    data
  })
}

export function orgDeleted (params) {
  return request({
    url: servicePath.userServer + '/organization/deleted',
    headers: {
      showLoading: true
    },
    method: 'get',
    params
  })
}
export function getOrganizationById (params) {
  return request({
    url: servicePath.userServer + '/organization/getOrganizationById',
    method: 'get',
    params
  })
}
export function updState (params) {
  return request({
    url: servicePath.userServer + '/organization/updState',
    headers: {
      showLoading: true
    },
    method: 'get',
    params
  })
}
export function updSync (params) {
  return request({
    url: servicePath.userServer + '/organization/updSync',
    headers: {
      showLoading: true
    },
    method: 'get',
    params
  })
}
export function dictData (data) {
  return request({
    url: servicePath.dictServer + '/dict/data/search',
    method: 'post',
    data
  })
}
